/*
 * CommuRoute.h
 *
 *  Created on: 2025-4-30
 *      Author: Andy.zhai
 */
#ifndef __COMMU_ROUTE_H__
#define __COMMU_ROUTE_H__

#include <stdint.h>

enum {
    MCU = 0,
    UART = 1,
    SPI = 2,
    SDIO = 3,
    TID_MAX_NUM,
};

// TID(Target ID)
#define TID_MCU   MCU
#define TID_UART  UART
#define TID_SPI   SPI
#define TID_SDIO  SDIO

// SID(Source ID)
#define SID_MCU   (TID_MCU  << 4)
#define SID_UART  (TID_UART << 4)
#define SID_SPI   (TID_SPI  << 4)
#define SID_SDIO  (TID_SDIO << 4)

// ROUTE
#define ROUTE_UART2APP  (SID_UART | TID_MCU)
#define ROUTE_SPI2APP   (SID_SPI  | TID_MCU)
#define ROUTE_SDIO2APP  (SID_SDIO | TID_MCU)

#define ROUTE_APP2UART  (SID_MCU | TID_UART)
#define ROUTE_APP2SPI   (SID_MCU | TID_SPI)
#define ROUTE_APP2SDIO  (SID_MCU | TID_SDIO)

void RouteData(uint8_t *data, uint32_t len);

#endif
